package com.redis.demo.controller;

import com.redis.demo.service.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *@ClassName StreamController
 *@Author 郭承乐
 *@Date 2024/8/22 9:37
 *@Version 1.0
 **/
@RequestMapping("/stream")
@RestController
public class StreamController {
    @Autowired
    private MessageProducer messageProducer;

    @PostMapping("/send")
    public void sendMessage(@RequestParam String key,@RequestParam String message) {
        messageProducer.sendMessage(key,message);
    }
}
